<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <div id="late_coach_teachertb">
        <form id="late_coach_teacherForm" class="ml10">
            星期：
            <select class="form-control1" name="week" id="week">
                <option value="">请选择</option>
                <option value="1">星期一</option>
                <option value="2">星期二</option>
                <option value="3">星期三</option>
                <option value="4">星期四</option>
                <option value="5">星期五</option>
                <option value="6">星期六</option>
                <option value="7">星期七</option>
            </select>
            晚修：
            <select class="form-control1" name="coachType" id="coachType">
                <option value="">请选择</option>
                <option value="2">晚修一</option>
                <option value="3">晚修二</option>
            </select>
            班级：
            <input id="classId" name="classId" type="number" class="easyui-validatebox" style="width:80px;">
            教师姓名：
            <input id="teacherName" name="teacherName" class="easyui-validatebox" style="width:100px;">
            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="searchForm('late_coach_teacher')">查询</a>
            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-clear'" onclick="resetForm('late_coach_teacher')">重置</a>
            <div class="mt10">
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="modify('late_coach_teacher')">修改</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" onclick="undo('late_coach_teacher')">取消</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="save('late_coach_teacher')">保存</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-tip',plain:true" onclick="downloadTemplate('晚修辅导教师名单.xls')">下载excel模板</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-large-smartart',plain:true" onclick="importExcel('late_coach_teacher')">导入</a>
            </div>
        </form>
    </div>
    <table id="late_coach_teacherdg">
        <thead>
            <tr>
                <th data-options="field:'ID',checkbox:true">ID</th>
                <th data-options='field:"WEEK",width:25,editor:{
                    type:"combobox",
                    options: {  
                        data: [{"value": "1", "text": "星期一"},{"value": "2", "text": "星期二"},{"value": "3", "text": "星期三"},{"value": "4", "text": "星期四"},{"value": "5", "text": "星期五"},{"value": "6", "text": "星期六"},{"value": "7", "text": "星期日"}],  
                        valueField: "value",  
                        textField: "text",  
                        editable: false,  
                        panelHeight:70,  
                        required: true  
                    }  
                },formatter : function(value,row,index){
                    return row.WEEK_TEXT;
                }'>星期</th>
                <th data-options="field:'CLASS_ID',width:25,editor:{type:'textbox',options:{required: true}}">班级</th>
                <th data-options="field:'COACH_TYPE',width:25,editor:{
                    type:'combobox',
                    options: {  
                        data: [{'value': '1', 'text': '晚修一'},{'value': '2', 'text': '晚修二'}],  
                        editable: false,  
                        panelHeight:70,  
                        required: true  
                    }  
                },formatter: function(value,row,index){
                    return row.COACH_TYPE_TEXT;
                }">晚修</th>
                <th data-options="field:'TEACHER_NAME',width:25,editor:{
                    type:'textbox',
                    options: {required: true}  
                }">教师姓名</th>
            </tr>
        </thead>
    </table>
    <div id="uploadBox" style="display: none;height: auto;">
        <div class="m30">
            <form method="post" enctype="multipart/form-data" id="late_coach_teacherUploadForm" action="">
                <div id="scoreTips">
                    
                </div>
                <div class="mt20">
                    <input class="easyui-filebox" data-options="buttonText:'选择文件'" id="files" name="files" style="width:250px;">
                </div>
            </form>
        </div>
        <div class="tnc m20">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="uploadCommit('late_coach_teacher')" style="width: 200px;">上传</a>
        </div>
    </div>
    <script type="text/javascript">
        var url = "/lateCoach/late_coach_teacher";
        $(function(){
            initDatagrid("late_coach_teacher", url);
        })
        function downloadTemplate(name){
            window.location.href = "__STATIC__/template/" + name;
        }

        function importExcel(cf) {
            $('#uploadBox').dialog({
                title : '晚修辅导教师名单',
                modal : true,
                width : 400,
                top : 100,
                buttons : '#btns'
            }).show();
        }
        function uploadCommit(cf){
            $.messager.progress({
                title : '提示',
                msg : '上传中，请稍候...'
            });
            $('#'+cf+'UploadForm').form('submit',{
                url: url + "/importExcel.html",
                success:function(data){
                $.messager.progress('close');
                if(data == '000') {
                    $.messager.show({title:'操作提示', msg:"上传成功"});
                    $('#uploadBox').dialog("close");
                    searchForm('late_coach_teacher');
                    return;
                }
                $.messager.alert('提示', data);
            }})
        }
    </script>

</body>
</html>